package com.mxz.system.controller;

import com.mxz.common.core.web.domain.AjaxResult;
import com.mxz.common.file.service.CommFileService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件请求处理
 *
 * @author mxz
 */
@Api(tags = "文件相关接口")
@RestController
@RequestMapping("/file")
public class SysFileController {

    @Autowired
    private CommFileService commFileService;

    /**
     * 文件上传请求
     */
    @PostMapping("/upload")
    @ApiOperation("上传文件")
    public AjaxResult upload(MultipartFile file) {
        return AjaxResult.success(commFileService.uploadFile(file));
    }
}